﻿using Dapper;
using System.Data.SqlClient;
using yunbo.Model.BIP;

namespace yunbo.Repositorys.BIPRepositorys
{
    public class GY_GXRepository
    {
        public string data = "Data Source=121.37.93.71;Initial Catalog=FanXingMES;User ID=sa;Password=geili@2025;";

        //查询所有未删除的BOM
        public List<GY_GX> GetGY_GX(string code)
        {
            using (SqlConnection connection = new SqlConnection(data))
            {
                string sql = $"select * from [dbo].[gy_gx] where gy_code='{code}'";
                List<GY_GX> gY_GXes = connection.Query<GY_GX>(sql).ToList(); // 使用 ToList() 获取所有菜单  
                return gY_GXes;
            }
        }
    }
}
